UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37oezxxZOnYUmgTC5uYe9TFE8J36PllhvPN07rF/p3o='
WHERE
key_id = '2d75179fa4c35da3cf900b182a4b66438fdac8d419c7e4d6951c3b8f352699af'
AND (
token = '37oezxxZOnYUmgTC5uYe9TFE8J36PllhvPN07rF/p3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)