UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzHSWCvu8Dq0oFOvQtuYKntvB4e39Ne0To300OTVUEA=' 
WHERE 
  key_id = '3eb5d9d241f700b167033d4c4fb2a1436151ba3368e079afaa78462eaa65017d' 
  AND (
    token = 'WzHSWCvu8Dq0oFOvQtuYKntvB4e39Ne0To300OTVUEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046