UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QO+cKWnmmnrrQ5a0mPNNd566Doe2mzV6D63XNsvLPjA='
WHERE
key_id = 'e3baa77435db6c852a4a842e5ed7c03ea0d2be0dfd0ec7c4b14297d17a8b4450'
AND (
token = 'QO+cKWnmmnrrQ5a0mPNNd566Doe2mzV6D63XNsvLPjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)