UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WTsrZ+r7VtQxf8070/3vxfAY3VESrNdZDqZUywKkIMA='
WHERE
key_id = '43b097300e54ec7cb135549746cf3aecdaeebadb9f4178747f2e1880e4f602ad'
AND (
token = 'WTsrZ+r7VtQxf8070/3vxfAY3VESrNdZDqZUywKkIMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)