UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k/dNlhGpLQsauaF6n9TgVOC6cl1gmn0eO+1EcLkvsSk=' 
WHERE 
  key_id = '60b4fd3e72384011b5944cc2c172408223cf3e23534957f60496461f09baf08b' 
  AND (
    token = 'k/dNlhGpLQsauaF6n9TgVOC6cl1gmn0eO+1EcLkvsSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030