UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q2EQ/6eUmpS9Aca0NQPkjhjfMNPtUjDi3fsc27fM2Go='
WHERE
key_id = '8814f42117d654ea6597b672e9d92dbcbdf9e75e0aa2528c1d06f55e9a629c58'
AND (
token = 'q2EQ/6eUmpS9Aca0NQPkjhjfMNPtUjDi3fsc27fM2Go='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)