UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sXWL48FD7ddV/Cpog35x1taif/zFt5ow8gAG7rZ7w6Y=' 
WHERE 
  key_id = 'bfb4604343c1a90797c847662e354cbca8422667fe232951003ee7533969c1ac' 
  AND (
    token = 'sXWL48FD7ddV/Cpog35x1taif/zFt5ow8gAG7rZ7w6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050