UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hbM8kpoY0M/6G8TYpPBlugTOvNqpOQQrRDE8ZFLEdPY=' 
WHERE 
  key_id = '37f5aec49994c02e2eee732a7c867e5f65cacd3bba76904f837242f01c2676cc' 
  AND (
    token = 'hbM8kpoY0M/6G8TYpPBlugTOvNqpOQQrRDE8ZFLEdPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040