UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K5zh8XVeGdVBO+thNEAbPUIg0MjJt5cZdxIacSCooe0=' 
WHERE 
  key_id = '7bb39116386ae7f9cf13b269a3bb122eaf25b89e3e12b349d8bef1424c75a2e8' 
  AND (
    token = 'K5zh8XVeGdVBO+thNEAbPUIg0MjJt5cZdxIacSCooe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051