UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BMKN8F9At2gvhz27ShZUR6BdYPgypMjW1KXzC/sZqYU='
WHERE
key_id = 'fc0cd5938413718d05ebe78ac4fa262a5693593f49234dddb86c2ec75be7b0b0'
AND (
token = 'BMKN8F9At2gvhz27ShZUR6BdYPgypMjW1KXzC/sZqYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)