UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3oJAMP/oefXpHqxxnG7pwY4UMxVBUzvs3Adpv/MimPs='
WHERE
key_id = 'd2a91848709947ff442df2cb302f1302d60e49aeab814c32990074a036ea41c3'
AND (
token = '3oJAMP/oefXpHqxxnG7pwY4UMxVBUzvs3Adpv/MimPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)