UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Br/3MYvxMR+B/AwzmUdz1UYFpamAGyVci25hmX23JiE=' 
WHERE 
  key_id = '1736619007f4d6d36eb318e1dad938bc55928cab9ab9cd4fc2a779613a30ec02' 
  AND (
    token = 'Br/3MYvxMR+B/AwzmUdz1UYFpamAGyVci25hmX23JiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026