UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MYg/8IdwIZ3vAOpEDz0+RtNhNLRyZoknhcZdy/2D95s=' 
WHERE 
  key_id = '991715d9c3fcd5a7a0ad08caefce3e5768a6cec81fa8d3bdf15cada736446fbd' 
  AND (
    token = 'MYg/8IdwIZ3vAOpEDz0+RtNhNLRyZoknhcZdy/2D95s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028