UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3G2VVDO1gejlIrIWRL/Nx12+BWYHB8EtWYqI/GATb2w='
WHERE
key_id = '972e8aa69c373784abd5ce36cb7649e809e03e9e0402d74e7be45765344f6857'
AND (
token = '3G2VVDO1gejlIrIWRL/Nx12+BWYHB8EtWYqI/GATb2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)