UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jjocd/XAJ+3+F6asiiKv5b7XOdClosb8kDJO8lxwZyc=' 
WHERE 
  key_id = 'bb80bd5e1ae0d55e098c8d27e503f9fb0d854319c93cf2a335197e94a2ddee54' 
  AND (
    token = 'Jjocd/XAJ+3+F6asiiKv5b7XOdClosb8kDJO8lxwZyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030