UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXIoR3+hCg+6+BTQvje3SNI+KdGPQ2egdQxRbYSKCS8='
WHERE
key_id = '2088d7902935622df99ea598eb65e668a1836be1a01f813ce417ed65407493bf'
AND (
token = 'RXIoR3+hCg+6+BTQvje3SNI+KdGPQ2egdQxRbYSKCS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)