UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jkqFGcOmofhRCVd5Zb00L75DNoLpo0NFdh2pZta9BH0='
WHERE
key_id = '2c486aed082f092624242bafd948ac0059d858bdca8edf77d7e9702bcc96768e'
AND (
token = 'jkqFGcOmofhRCVd5Zb00L75DNoLpo0NFdh2pZta9BH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)