UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vZfGwsubcZUXwT3/7VXTq+DrJc20bywd1pOcRYTVBZE=' 
WHERE 
  key_id = 'e0ae5fa593adea3bb578172c97d05f116f44b3bbb1434c4926b6c253ce4e12c6' 
  AND (
    token = 'vZfGwsubcZUXwT3/7VXTq+DrJc20bywd1pOcRYTVBZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060