UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BFO2vT6ZVy8qVfdmcGEbAL81xOeqhuXSk4ciB5ng5Z4='
WHERE
key_id = '293a2c4bdb4c20fbf757b1d615c917b8c6f1a977433a2259a1076382c97d66d0'
AND (
token = 'BFO2vT6ZVy8qVfdmcGEbAL81xOeqhuXSk4ciB5ng5Z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)