UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ssNlu+qRBEQ7jW5eRlRvF5BYSzYinKHFPXHGmKbTcGk='
WHERE
key_id = 'b006e9b37d768a2c6f5430332d6700a29587a5a7e308e841d262edf43ef8f79e'
AND (
token = 'ssNlu+qRBEQ7jW5eRlRvF5BYSzYinKHFPXHGmKbTcGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)