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