UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MgfNOV+VUyIoDma0Uh/piZk0+5ugrHIPhLzxJwuBpaQ='
WHERE
key_id = '5d2ba9e61c1042cab67f19c62a63d7a107fc2f056d3041eaf4d2c6a4e83e6b9c'
AND (
token = 'MgfNOV+VUyIoDma0Uh/piZk0+5ugrHIPhLzxJwuBpaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)