UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NEqkfFsA+zFgoq7RJQW3Uk5SozIsJcguXGlHZhldhK0='
WHERE
key_id = '23954b4ee5ef9dfbf298b00e484f7f1cb6e5f715b81b57fce25d9e4f9820595c'
AND (
token = 'NEqkfFsA+zFgoq7RJQW3Uk5SozIsJcguXGlHZhldhK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)