UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2wa/Sa57E+1lKB07lCikc4BIRuMsZO2zHSU47W0GgKg='
WHERE
key_id = '2a5e387547c3d88d8ed28896f5079a75280314dcd82991e37d2caaa692403c02'
AND (
token = '2wa/Sa57E+1lKB07lCikc4BIRuMsZO2zHSU47W0GgKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)