UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GjC3rHoJ9puinTcN+uqPYVIl67huqdtAkp4lyo1kWEc=' 
WHERE 
  key_id = '10e1a4b3b6785a44cfa3b2ab0e1bed2c6d4d57d256f5ef6696ec5b51b2d22d1e' 
  AND (
    token = 'GjC3rHoJ9puinTcN+uqPYVIl67huqdtAkp4lyo1kWEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016