UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'erWayjTYiAO/Bi/8rF0dFDZimKBWwg/BstkN0ziM/oQ=' 
WHERE 
  key_id = 'a2c0eba6848dadb5f2c1d8519ed94a2ea6f12708cf7df0c7722be0b5fe5f8eb9' 
  AND (
    token = 'erWayjTYiAO/Bi/8rF0dFDZimKBWwg/BstkN0ziM/oQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039