UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K9P9ztNUoTs2y1rFA/nLyWkXFmC0GhuLxQQoLbunn6E=' 
WHERE 
  key_id = '719876178e2111018807a7f363e832c05f22ee50cb244c0dd1b89bdd60047c85' 
  AND (
    token = 'K9P9ztNUoTs2y1rFA/nLyWkXFmC0GhuLxQQoLbunn6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017