UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UlZUxqrfxGyR+ZijT3ZjMhLB7F8jTClaNYUVOXx4Ajg=' 
WHERE 
  key_id = 'cd1f872ca9eff9540854c8be8b2c92b53cad795d1e974e2ed533fec25ccee7a0' 
  AND (
    token = 'UlZUxqrfxGyR+ZijT3ZjMhLB7F8jTClaNYUVOXx4Ajg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034