UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kNxvAC1yDlnUv1KSC9rGJgwMryBCcTROwVfYszqdTPI='
WHERE
key_id = '4d005ccf98e383ab1991c0f01d4707aba7235814ba2b71b85a633954071f2f45'
AND (
token = 'kNxvAC1yDlnUv1KSC9rGJgwMryBCcTROwVfYszqdTPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)