UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIIOhiCNE55imXKnvHTXy85aVjVpMekiZEnQawFa6n0='
WHERE
key_id = 'cfb55ac4e5355c32c196e653a31ce05459d63576ee4eb98e019f7b67725aabfd'
AND (
token = 'vIIOhiCNE55imXKnvHTXy85aVjVpMekiZEnQawFa6n0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)