UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TKlnmirEOg/XpncNb8rOqaVDfseztwJLzPgT0ao8OU='
WHERE
key_id = 'c7fd0bd416bc8495aa29931f34bb5d4de09eaff3d8a52ef0c33743d77d85a121'
AND (
token = '2TKlnmirEOg/XpncNb8rOqaVDfseztwJLzPgT0ao8OU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)