UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MO8bBzigTdxW06CWx/xaWiyk/v3l1SbPeVWZPQNE8Bo='
WHERE
key_id = '8652f6a4adec206b638e3a563175dbcea489c0cc570ba9cbcf61ae9699cfbfab'
AND (
token = 'MO8bBzigTdxW06CWx/xaWiyk/v3l1SbPeVWZPQNE8Bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)