UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FCNlXRZjnw4wKHDFPKoW/2YTsA7eviNK4fFf3ybC5Pk='
WHERE
key_id = '26a0d2dcac777b4881b487f1042f6306903910e77c050d53b472e1968a135339'
AND (
token = 'FCNlXRZjnw4wKHDFPKoW/2YTsA7eviNK4fFf3ybC5Pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)