UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BPyVVo1AIc2j3ebt1j2m2og5AFlUTtSHrHb4qoGnhQE='
WHERE
key_id = '4d7bb30907fae4397b1180370d7210c8e49a8b9d95ddba357f7bcaf5bdc5ce8f'
AND (
token = 'BPyVVo1AIc2j3ebt1j2m2og5AFlUTtSHrHb4qoGnhQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)