UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vSGMEne7Hy8qxGmYF4sYGbwq2dpsfhB5C9EN0qXQc2M='
WHERE
key_id = 'd00144301ddd6b084924f2ad61a00026b87a3f8eedeae98f2dc287c428285bdd'
AND (
token = 'vSGMEne7Hy8qxGmYF4sYGbwq2dpsfhB5C9EN0qXQc2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)