UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ckGLroEeXASPZp3TcA/25HuwwKqO6Tv4tgITGelTLp4=' 
WHERE 
  key_id = 'fbe4b905e2312b91ad9884715dcc520ccf12a4b70625b13c470732b6d105c3b2' 
  AND (
    token = 'ckGLroEeXASPZp3TcA/25HuwwKqO6Tv4tgITGelTLp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046