UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kXvEUkuNocjzncpPDNyaIgm8DKdMdh1DWEIXysW6Gjs='
WHERE
key_id = '980db863b44d755d5c5ffa48166aee29c067310d4912622db9cc00d175914172'
AND (
token = 'kXvEUkuNocjzncpPDNyaIgm8DKdMdh1DWEIXysW6Gjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)