UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E1o/6YzP+2LYQtz3cXwq+ej2FnaVmKf5/OTELVjX3vs='
WHERE
key_id = '7a800731b6c4aeb0ee73d04164aecb1bbcdda0148e6a4b59e2ff6c7b37536fc7'
AND (
token = 'E1o/6YzP+2LYQtz3cXwq+ej2FnaVmKf5/OTELVjX3vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)