UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qZEDqxR2WdEvyKJk0OiUBygjEQ7Ib7GzQndTtfSGbUY=' 
WHERE 
  key_id = '701cafcc88902ad79e38fc3c742a59eb124afd8d0d45a5a946669d85181775b4' 
  AND (
    token = 'qZEDqxR2WdEvyKJk0OiUBygjEQ7Ib7GzQndTtfSGbUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044