UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3FhOQNdnLHmny98hCCY1B0S86gX+87HL0CmfHFUAPc='
WHERE
key_id = '71e866082091ee0f6c53b8fb7a96345df3e969921b4873cdacce1e1aa133bf2c'
AND (
token = 'c3FhOQNdnLHmny98hCCY1B0S86gX+87HL0CmfHFUAPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)