UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sVM+2VEZfhKN/RfmH+nxwwFXriv1wqiRMDFGRZEaPH8=' 
WHERE 
  key_id = '2cc4e806b955d136a07e4cb4253753bf3ae60a7d40ac035a9d9b5bf7861fd03f' 
  AND (
    token = 'sVM+2VEZfhKN/RfmH+nxwwFXriv1wqiRMDFGRZEaPH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027