UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7D+fYa+6OQzUPzhrEOsGACWH2kFnLEn2M7M4u8d0MYE='
WHERE
key_id = '8c29c4ac16d6e8815c9fa6c36957b84be0bb50f05eae5ec88f7ace5f21d398e1'
AND (
token = '7D+fYa+6OQzUPzhrEOsGACWH2kFnLEn2M7M4u8d0MYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)