UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kRemfmhyXT8nY71et/Dc7ZejeJdIc4oAZyunUzL6k0c='
WHERE
key_id = 'ab73434efc110cbc62ee060bbd033189960399144ce4d1f303ffa331a3f50c8d'
AND (
token = 'kRemfmhyXT8nY71et/Dc7ZejeJdIc4oAZyunUzL6k0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)