UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '93NhVjqZaBHSnXzZjRQ0vK+gTUnwHtb7BrWWP9MGQv8='
WHERE
key_id = '4f0bc4ab04be01f8ad44365c48155791a089c0bd6d7886d6f4e5daf3c7797f8b'
AND (
token = '93NhVjqZaBHSnXzZjRQ0vK+gTUnwHtb7BrWWP9MGQv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)