UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vyHfrOaqC9CfQzWtf2NhQdE0QyTayI5xpMiSMAeXeek=' 
WHERE 
  key_id = '4a9a5894accff87f327f1aa618c223ea3f241db93352a13bea263ae80e0f747d' 
  AND (
    token = 'vyHfrOaqC9CfQzWtf2NhQdE0QyTayI5xpMiSMAeXeek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017