UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMT3AZU1Zy+2MUZGt81MNRFbQUciTGtU0AOK0YXp/ic=' 
WHERE 
  key_id = '4c155503cb6788eafc6eacb017605b662d5b7ee35a9d526e40771e1867d5a30d' 
  AND (
    token = 'ZMT3AZU1Zy+2MUZGt81MNRFbQUciTGtU0AOK0YXp/ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058