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