UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yIPPjubK5oIngzBmdXIXb42Of5JYltiOvAaNWUYXC/8='
WHERE
key_id = 'edb26cc5e530c194b5d7062d90e74efb91ff56177aa0e09f3b109d307a2a1259'
AND (
token = 'yIPPjubK5oIngzBmdXIXb42Of5JYltiOvAaNWUYXC/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)