UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RZMA5zJg9SUruYBH/Xb3CcOtH7OE+yAd9YkYNjHbRFs=' 
WHERE 
  key_id = '637d93e1194f56a710ffcba9ce9f880774ecdd18e7f90ef4d55367ef3d60c500' 
  AND (
    token = 'RZMA5zJg9SUruYBH/Xb3CcOtH7OE+yAd9YkYNjHbRFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034