UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kJbGYy73t9hkAqrgAsHznLsA3vMoqtRHN8wvu3WUg/o='
WHERE
key_id = 'b3176ceeda9e4b0ff74c7c60219c3fc136f7c583df875e63f185e30e96c39fd6'
AND (
token = 'kJbGYy73t9hkAqrgAsHznLsA3vMoqtRHN8wvu3WUg/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)